/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2010.

	This file is part of Maxsi Client.

	Maxsi Client is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi Client is distributed in the hope that it will be useful, but WITHOUT
	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
	FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
	License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Client. If not, see <http://www.gnu.org/licenses/>.

	Maxsi Client
	A client UI to the digital distribution platform Maxsi Distribution.

	UI.cpp
	Defines a page system that extends the Maxsi Window System.

******************************************************************************/

#include "MaxsiLibrary.h"
#include "UI.h"

MaxsiWindowSystem*	WindowSystem		=	NULL;
MaxsiWindow*		MainWindow			=	NULL;

Page::Page()
{
	Window	=	NULL;
}

Page::~Page()
{
	
}

void Page::SetWindow(MaxsiWindow* NewWindow)
{
	Window				=	NewWindow;
	ShouldDestroyPage	=	false;
	NextPage			=	NULL;
}

void Page::DestroyPage()
{
	ShouldDestroyPage	=	true;
	NextPage			=	NULL;
}

MaxsiError Page::SetReplacement(Page* Replacement)
{
	if ( Replacement == NULL ) { return MAXSI_ERROR_MEM_ALLOC_FAIL; }

	ShouldDestroyPage	=	true;
	NextPage			=	Replacement;

	return MAXSI_ERROR_SUCCESS;
}


